import Vue from "vue";

import ElementUI from "element-ui";

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";

import "@/icons"; // icon
import "@/permission"; // permission control

//echarts 懒加载
import "components/echarts";

// 全局注入自己封装的组件
import globalComp from "components";
Vue.use(globalComp);

//加载loading
import { openLoading } from "@/common/js/loading.js";
Vue.prototype.openLoading = openLoading;

Vue.prototype.$EventBus = new Vue();

//提示信息
import DonMessage from "@/common/js/message.js";
Vue.prototype.message = new DonMessage(); //消息提示

//全局通用的工具函数
import * as utils from "@/utils/index";
Vue.prototype.utils = utils;

//时间格式化 @http://momentjs.cn/
import moment from "moment";
Vue.prototype.$moment = moment;

//全局的文字配置
import { config } from "./config";
Vue.prototype.config = config;

//国际化
import i18n from "./i18n/index";
import locale from "element-ui/lib/locale/lang/en";

Vue.use(ElementUI, { size: "small", locale });

Vue.config.productionTip = false;

// 引入markdown编辑器
import mavonEditor from "mavon-editor";
import "mavon-editor/dist/css/index.css";

Vue.use(mavonEditor);

new Vue({
  el: "#app",
  router,
  store,
  i18n,
  render: (h) => h(App),
});
